package com.service.business.merchant.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.service.business.merchant.controller.rep.CreditLineStatementPageRep;
import com.service.business.merchant.controller.rep.MemberCreditLineRep;
import com.service.core.rest.request.PageRequest;
import com.service.core.rest.response.CommonPageRep;
import com.service.dao.dto.MerchantCreditLineChange;
import com.service.dao.enums.CoinsEnum;
import com.service.dao.model.MemberStore;
import com.service.dao.model.MerchantCreditLine;

import java.math.BigDecimal;
import java.util.stream.Stream;


/**
 * 商家信用额度
 *
 * @author xxxx
 * @email xxxx@qq.com
 * @date 2020-04-01 20:13:14
 */
public interface MerchantCreditLineService extends IService<MerchantCreditLine> {

    MemberCreditLineRep merchantCreditLine();

    CommonPageRep<CreditLineStatementPageRep> pageStatement(CoinsEnum coins, PageRequest pageRequest);

    /**
     * 更新商家授信额度
     * @param creditLineChange
     */
    void updateCreditLineBalance(MerchantCreditLineChange creditLineChange);

    MerchantCreditLine getCreditLine(Integer merchantId, String coins);

    MerchantCreditLine getCreditLine(Integer merchantId, CoinsEnum coins);

    void repayment(MerchantCreditLine creditLine, MemberStore memberStore, BigDecimal repaymentNum);
}

